<template>
  <div class="searchClosed">
    <div class="searchClosed-top">
      <i class="el-icon-warning" type="primary"/>
      <br>
      <span>尚未启用云搜索</span>
      <br>
      <span style="display:block;padding-top:20px;">
        多姿多彩的教学资源，一处搜齐。
        <a href="https://www.baidu.com" target="_black" style="color:#409eff">点击这里</a> 了解详情。
      </span>
      <br>
      <el-button type="primary" size="medium" @click="createData()">立即启用</el-button>
    </div>
    <div class="searchClosed-main">
      <h4>搜索范围说明</h4>
      <p>－课程：包括课程标题、课程简介、课时标题等内容关键词全文搜索。</p>
      <p>－班级：包括班级标题、班级介绍等内容。</p>
      <p>－教师：教师姓名、教师头衔。</p>
      <p>－小组话题：包括话题标题、正文等关键词全文搜索。</p>
      <p>－资讯：包括资讯标题、正文等关键词全文搜索。</p>
      <p>－公开课：包括课程标题、课程简介等内容关键词全文搜索。</p>
    </div>
  </div>
</template>

<script>
  import {getTenantId} from '@/utils/auth';
  import {addData} from '@/api/cloud/cloud_search_set';

  export default {
    data() {
      return {
        CloudSearchSet: {
          status: '0',
        },
      }
    },
    methods: {
      createData() {
        this.CloudSearchSet.tenantId = getTenantId();
        this.CloudSearchSet.status = '1';
        addData(this.CloudSearchSet).then(() => {
          this.$notify({
            title: '成功',
            message: '操作成功',
            type: 'success',
            duration: 2000
          });
        });
        this.$emit('open')
      },
    }
  }
</script>

<style lang="scss">
  .searchClosed {
    width: 900px;
    box-shadow: 0 0px 10px rgba(205, 225, 225, 1);
    margin-top: 30px;

    &-top {
      width: 100%;
      height: 207px;
      text-align: center;
      padding-top: 50px;

      .el-icon-warning {
        font-size: 50px;
        margin-bottom: 10px;
        color: #409eff;
      }
    }

    &-main {
      width: 100%;

      h4 {
        padding-left: 5px;
        font-size: 18px;
        margin-bottom: 10px;
      }

      p {
        margin: 0;
        line-height: 36px;
        font-size: 16px;
        text-align: left;
        padding-left: 20px;
      }
    }
  }
</style>
